<?php
/**
 * Created by PhpStorm.
 * User: cheng
 * Date: 2017/2/8
 * Time: 16:36
 */
class CreateJson{
    public function response($code, $message = '', $data = array()) {
        if(!(is_numeric($code))) {
            return '';
        }
        $result = array(
            'code' => $code,
            'message' => $message,
            'data' => $data
        );
        echo json_encode($result);
        exit;
    }
}